package com.pjb.springbootjwt.train.entity;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class Train {

    private List<String> objs = new ArrayList<>();
    private String key;
    private String name;

    public static Train toTrain(String s) {
        String[] arr = s.split(":");
        Train t = new Train();
        t.setKey(arr[0]);
        t.setName(arr[1]);
        return t;
    }

    public static void main(String[] args) throws InterruptedException {
        System.out.println(toTrain("T1004:王小倩"));
    }
}
